<?php

class Category extends Eloquent
{
	/**
	 * Specifies which attributes should be mass-assignable
	 * @var array
	 */
 	protected $fillable = array('name', 'slug');
 	
 	/**
 	 * Create the validation rules
 	 * @var array
 	 */
 	public static $rules = array('name' => 'required');
 	
 	
 	/**
 	 * Create custom validation messages
 	 * @var array
 	 */
 	public static $messages = array('required' => ':attribute cần nhập giá trị.');
 	
 	/*****************
 	 * Relationships *
 	*****************/
	public function products()
	{
	    return $this->hasMany('Product');
	}

	public function seo()
	{
	    return $this->morphMany('Seo', 'seoble');
	}
}